<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: Mainloop mode (&quot;NO_SYS&quot;)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__lwip__nosys.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Mainloop mode ("NO_SYS")<div class="ingroups"><a class="el" href="group__lwip.html">lwIP</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga0c1a18439524d2f4a5e51d25c0ca2ce9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__nosys.html#ga0c1a18439524d2f4a5e51d25c0ca2ce9">lwip_init</a> (void)</td></tr>
<tr class="separator:ga0c1a18439524d2f4a5e51d25c0ca2ce9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3c420dab0c6760df099a2d688fa42a26"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__nosys.html#ga3c420dab0c6760df099a2d688fa42a26">ip_input</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, struct <a class="el" href="structnetif.html">netif</a> *inp)</td></tr>
<tr class="separator:ga3c420dab0c6760df099a2d688fa42a26"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5532f93d68c874fb99c681bff2165385"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__nosys.html#ga5532f93d68c874fb99c681bff2165385">netif_input</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, struct <a class="el" href="structnetif.html">netif</a> *inp)</td></tr>
<tr class="separator:ga5532f93d68c874fb99c681bff2165385"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga83cffdf69ab60fd0eba9d17d363f9883"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__nosys.html#ga83cffdf69ab60fd0eba9d17d363f9883">sys_check_timeouts</a> (void)</td></tr>
<tr class="separator:ga83cffdf69ab60fd0eba9d17d363f9883"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6a10c58b82c56d02c48b3cfa2c2494ff"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__nosys.html#ga6a10c58b82c56d02c48b3cfa2c2494ff">ethernet_input</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>)</td></tr>
<tr class="separator:ga6a10c58b82c56d02c48b3cfa2c2494ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Use this mode if you do not run an OS on your system. #define NO_SYS to 1. Feed incoming packets to netif-&gt;input(pbuf, netif) function from mainloop, <em>not</em> <em>from</em> <em>interrupt</em> <em>context</em>. You can allocate a <a class="el" href="group__pbuf.html">Packet buffers (PBUF)</a> in interrupt context and put them into a queue which is processed from mainloop.<br />
Call <a class="el" href="group__lwip__nosys.html#ga83cffdf69ab60fd0eba9d17d363f9883">sys_check_timeouts()</a> periodically in the mainloop.<br />
Porting: implement all functions in <a class="el" href="group__sys__time.html">Time</a>, <a class="el" href="group__sys__prot.html">Critical sections</a> and <a class="el" href="group__compiler__abstraction.html">Compiler/platform abstraction</a>.<br />
You can only use <a class="el" href="group__callbackstyle__api.html">"raw" APIs</a> in this mode.<br />
Sample code:<br />
</p><div class="fragment"><div class="line"><span class="keywordtype">void</span></div><div class="line">eth_mac_irq()</div><div class="line">{</div><div class="line">  <span class="comment">/* Service MAC IRQ here */</span></div><div class="line"></div><div class="line">  <span class="comment">/* Allocate pbuf from pool (avoid using heap in interrupts) */</span></div><div class="line">  <span class="keyword">struct </span><a class="code" href="structpbuf.html">pbuf</a>* p = <a class="code" href="group__pbuf.html#gacfcb0a2af918658ba0afe36499c65f47">pbuf_alloc</a>(<a class="code" href="group__pbuf.html#ggaee1baa59bb2f85ba575b5a8619ac1ebfa21116654fbab6d5a4dfeb87a1bb8f0ba">PBUF_RAW</a>, eth_data_count, <a class="code" href="group__pbuf.html#ggab7e0e32fcc292c0d7107721766ed92fbae969347127387b9b59a23ccd24b76d21">PBUF_POOL</a>);</div><div class="line"></div><div class="line">  <span class="keywordflow">if</span>(p != NULL) {</div><div class="line">    <span class="comment">/* Copy ethernet frame into pbuf */</span></div><div class="line">    <a class="code" href="group__pbuf.html#gad1e31e370271335b197272af2724ca85">pbuf_take</a>(p, eth_data, eth_data_count);</div><div class="line"></div><div class="line">    <span class="comment">/* Put in a queue which is processed in main loop */</span></div><div class="line">    <span class="keywordflow">if</span>(!queue_try_put(&amp;queue, p)) {</div><div class="line">      <span class="comment">/* queue is full -&gt; packet loss */</span></div><div class="line">      <a class="code" href="group__pbuf.html#gab0dd696fb4b6bc65e548944584f1738b">pbuf_free</a>(p);</div><div class="line">    }</div><div class="line">  }</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <a class="code" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> </div><div class="line">netif_output(<span class="keyword">struct</span> netif *netif, <span class="keyword">struct</span> <a class="code" href="structpbuf.html">pbuf</a> *p)</div><div class="line">{</div><div class="line">  LINK_STATS_INC(link.xmit);</div><div class="line"></div><div class="line">  <span class="comment">/* Update SNMP stats (only if you use SNMP) */</span></div><div class="line">  <a class="code" href="group__netif__mib2.html#ga05641438775014b7e13b9e55eba48bed">MIB2_STATS_NETIF_ADD</a>(netif, ifoutoctets, p-&gt;<a class="code" href="structpbuf.html#a5259e7ec29bab9c0999b64f2e86b411f">tot_len</a>);</div><div class="line">  <span class="keywordtype">int</span> unicast = ((p-&gt;<a class="code" href="structpbuf.html#a8d32dc3e964369d4eec638fc37fbc460">payload</a>[0] &amp; 0x01) == 0);</div><div class="line">  <span class="keywordflow">if</span> (unicast) {</div><div class="line">    <a class="code" href="group__netif__mib2.html#ga3c52caf566d37705c6547f2d025afd9f">MIB2_STATS_NETIF_INC</a>(netif, ifoutucastpkts);</div><div class="line">  } <span class="keywordflow">else</span> {</div><div class="line">    <a class="code" href="group__netif__mib2.html#ga3c52caf566d37705c6547f2d025afd9f">MIB2_STATS_NETIF_INC</a>(netif, ifoutnucastpkts);</div><div class="line">  }</div><div class="line"></div><div class="line">  lock_interrupts();</div><div class="line">  <a class="code" href="group__pbuf.html#gac2f1f58fd36042e82af46f5015720899">pbuf_copy_partial</a>(p, mac_send_buffer, p-&gt;<a class="code" href="structpbuf.html#a5259e7ec29bab9c0999b64f2e86b411f">tot_len</a>, 0);</div><div class="line">  <span class="comment">/* Start MAC transmit here */</span></div><div class="line">  unlock_interrupts();</div><div class="line"></div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__infrastructure__errors.html#ggae2e66c7d13afc90ffecd6151680fbadcaa26c163b80b1f6786ca81dadc14b00fb">ERR_OK</a>;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> </div><div class="line">netif_status_callback(<span class="keyword">struct</span> netif *netif)</div><div class="line">{</div><div class="line">  printf(<span class="stringliteral">&quot;netif status changed %s\n&quot;</span>, <a class="code" href="ip4__addr_8c.html#a28620fdd443c5c98d15e5890cbd9059c">ip4addr_ntoa</a>(<a class="code" href="group__netif__ip4.html#gac9b6e63b5dd2968fe0a4813f3eefb55d">netif_ip4_addr</a>(netif)));</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keyword">static</span> <a class="code" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> </div><div class="line">netif_init(<span class="keyword">struct</span> netif *netif)</div><div class="line">{</div><div class="line">  netif-&gt;<a class="code" href="structnetif.html#acaaac9b415a7be73eb8a287c8ed18a8d">linkoutput</a> = netif_output;</div><div class="line">  netif-&gt;<a class="code" href="structnetif.html#a8e1dcfe65db487feecd244355f39215e">output</a>     = <a class="code" href="etharp_8c.html#a19258c75a3778b6ed0c82f63a419502d">etharp_output</a>;</div><div class="line">  netif-&gt;<a class="code" href="structnetif.html#ac38383379cff22c402156fec71c19617">output_ip6</a> = <a class="code" href="ethip6_8c.html#ab5326546d33174f91f1fb0cc6d398bfd">ethip6_output</a>;</div><div class="line">  netif-&gt;<a class="code" href="structnetif.html#aca7d56b4e0f822b0ced2885f222b8d48">mtu</a>        = ETHERNET_MTU;</div><div class="line">  netif-&gt;<a class="code" href="structnetif.html#a1c171db6097bbb6f09f63549a66e00ea">flags</a>      = <a class="code" href="group__netif__flags.html#gaef64fe15c82bc7b235366923e517104e">NETIF_FLAG_BROADCAST</a> | <a class="code" href="group__netif__flags.html#ga92448dc510bc8d700c09e5c971ef0676">NETIF_FLAG_ETHARP</a> | <a class="code" href="group__netif__flags.html#ga76ad9d0cf9f029df0ab2a998c64040dc">NETIF_FLAG_ETHERNET</a> | <a class="code" href="group__netif__flags.html#gac9493b923d733c73f6006d9714826558">NETIF_FLAG_IGMP</a> | <a class="code" href="group__netif__flags.html#gab14fbe1447d2fdbdf5abc87f51eb6508">NETIF_FLAG_MLD6</a>;</div><div class="line">  <a class="code" href="group__netif__mib2.html#ga5be1b8cba1d67bf6e7f8851ec91b10f0">MIB2_INIT_NETIF</a>(netif, snmp_ifType_ethernet_csmacd, 100000000);</div><div class="line"></div><div class="line">  <a class="code" href="group__lwip__opts__memcpy.html#ga8c6e3c1e4f74acb16376188dbf8909ec">SMEMCPY</a>(netif-&gt;<a class="code" href="structnetif.html#aee967965d999fc1a4c40a66709304e69">hwaddr</a>, your_mac_address_goes_here, ETH_HWADDR_LEN);</div><div class="line">  netif-&gt;<a class="code" href="structnetif.html#afe1181561cb16241f3cb5ed01e567d42">hwaddr_len</a> = ETH_HWADDR_LEN;</div><div class="line"></div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__infrastructure__errors.html#ggae2e66c7d13afc90ffecd6151680fbadcaa26c163b80b1f6786ca81dadc14b00fb">ERR_OK</a>;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> </div><div class="line">main(<span class="keywordtype">void</span>)</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>netif netif;</div><div class="line"></div><div class="line">  <a class="code" href="group__lwip__nosys.html#ga0c1a18439524d2f4a5e51d25c0ca2ce9">lwip_init</a>();</div><div class="line"></div><div class="line">  <a class="code" href="group__netif.html#gade5498543e74067f28cc6bef0209e3be">netif_add</a>(&amp;netif, <a class="code" href="group__ip4addr.html#gae920b6e81610a38cf9ada52118807eff">IP4_ADDR_ANY</a>, <a class="code" href="group__ip4addr.html#gae920b6e81610a38cf9ada52118807eff">IP4_ADDR_ANY</a>, <a class="code" href="group__ip4addr.html#gae920b6e81610a38cf9ada52118807eff">IP4_ADDR_ANY</a>, NULL, netif_init, <a class="code" href="group__lwip__nosys.html#ga5532f93d68c874fb99c681bff2165385">netif_input</a>);</div><div class="line">  netif.<a class="code" href="structnetif.html#a32fca6ffd28bb9af3f891a378827a67e">name</a>[0] = <span class="charliteral">&#39;e&#39;</span>;</div><div class="line">  netif.<a class="code" href="structnetif.html#a32fca6ffd28bb9af3f891a378827a67e">name</a>[1] = <span class="charliteral">&#39;0&#39;</span>;</div><div class="line">  <a class="code" href="group__netif__ip6.html#gae864211a5eb052deb5da7bc7e3427fb9">netif_create_ip6_linklocal_address</a>(&amp;netif, 1);</div><div class="line">  netif.<a class="code" href="structnetif.html#ad98bafb7733b40ef898e53d91fbfa20f">ip6_autoconfig_enabled</a> = 1;</div><div class="line">  <a class="code" href="group__netif.html#gadc8787b23ac0ee023979cbadf87813d4">netif_set_status_callback</a>(&amp;netif, netif_status_callback);</div><div class="line">  <a class="code" href="group__netif.html#gac90f290edd005238d62aa94c4ac9dea3">netif_set_default</a>(&amp;netif);</div><div class="line">  <a class="code" href="group__netif.html#gaf19693be401a265a52d2a56c65753121">netif_set_up</a>(&amp;netif);</div><div class="line">  </div><div class="line">  <span class="comment">/* Start DHCP and HTTPD */</span></div><div class="line">  <a class="code" href="group__dhcp4.html#ga0c50968d9811aa2aa67fadc0885d744f">dhcp_start</a>(&amp;netif );</div><div class="line">  <a class="code" href="group__httpd.html#gac364305cee969a0be43c071722b136e6">httpd_init</a>();</div><div class="line"></div><div class="line">  <span class="keywordflow">while</span>(1) {</div><div class="line">    <span class="comment">/* Check link state, e.g. via MDIO communication with PHY */</span></div><div class="line">    <span class="keywordflow">if</span>(link_state_changed()) {</div><div class="line">      <span class="keywordflow">if</span>(link_is_up()) {</div><div class="line">        <a class="code" href="group__netif.html#gae0d2975f189277990e9d5276fdd9e9ea">netif_set_link_up</a>(&amp;netif);</div><div class="line">      } <span class="keywordflow">else</span> {</div><div class="line">        <a class="code" href="group__netif.html#ga34e37a1e8e358760dc1c43887922c7db">netif_set_link_down</a>(&amp;netif);</div><div class="line">      }</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">/* Check for received frames, feed them to lwIP */</span></div><div class="line">    lock_interrupts();</div><div class="line">    <span class="keyword">struct </span><a class="code" href="structpbuf.html">pbuf</a>* p = queue_try_get(&amp;queue);</div><div class="line">    unlock_interrupts();</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span>(p != NULL) {</div><div class="line">      LINK_STATS_INC(link.recv);</div><div class="line"> </div><div class="line">      <span class="comment">/* Update SNMP stats (only if you use SNMP) */</span></div><div class="line">      <a class="code" href="group__netif__mib2.html#ga05641438775014b7e13b9e55eba48bed">MIB2_STATS_NETIF_ADD</a>(netif, ifinoctets, p-&gt;<a class="code" href="structpbuf.html#a5259e7ec29bab9c0999b64f2e86b411f">tot_len</a>);</div><div class="line">      <span class="keywordtype">int</span> unicast = ((p-&gt;<a class="code" href="structpbuf.html#a8d32dc3e964369d4eec638fc37fbc460">payload</a>[0] &amp; 0x01) == 0);</div><div class="line">      <span class="keywordflow">if</span> (unicast) {</div><div class="line">        <a class="code" href="group__netif__mib2.html#ga3c52caf566d37705c6547f2d025afd9f">MIB2_STATS_NETIF_INC</a>(netif, ifinucastpkts);</div><div class="line">      } <span class="keywordflow">else</span> {</div><div class="line">        <a class="code" href="group__netif__mib2.html#ga3c52caf566d37705c6547f2d025afd9f">MIB2_STATS_NETIF_INC</a>(netif, ifinnucastpkts);</div><div class="line">      }</div><div class="line"></div><div class="line">      <span class="keywordflow">if</span>(netif.<a class="code" href="structnetif.html#a8fe4f1b7b0d710216287da9615164a5c">input</a>(p, &amp;netif) != <a class="code" href="group__infrastructure__errors.html#ggae2e66c7d13afc90ffecd6151680fbadcaa26c163b80b1f6786ca81dadc14b00fb">ERR_OK</a>) {</div><div class="line">        <a class="code" href="group__pbuf.html#gab0dd696fb4b6bc65e548944584f1738b">pbuf_free</a>(p);</div><div class="line">      }</div><div class="line">    }</div><div class="line">     </div><div class="line">    <span class="comment">/* Cyclic lwIP timers check */</span></div><div class="line">    <a class="code" href="group__lwip__nosys.html#ga83cffdf69ab60fd0eba9d17d363f9883">sys_check_timeouts</a>();</div><div class="line">     </div><div class="line">    <span class="comment">/* your application goes here */</span></div><div class="line">  }</div><div class="line">}</div></div><!-- fragment --> <h2 class="groupheader">Function Documentation</h2>
<a id="ga6a10c58b82c56d02c48b3cfa2c2494ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6a10c58b82c56d02c48b3cfa2c2494ff">&#9670;&nbsp;</a></span>ethernet_input()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> ethernet_input </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Process received ethernet frames. Using this function instead of directly calling ip_input and passing ARP frames through etharp in ethernetif_input, the ARP cache is protected from concurrent access.<br />
Don't call directly, pass to <a class="el" href="group__netif.html#gade5498543e74067f28cc6bef0209e3be">netif_add()</a> and call netif-&gt;input().</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the received packet, p-&gt;payload pointing to the ethernet header </td></tr>
    <tr><td class="paramname">netif</td><td>the network interface on which the packet was received</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__lwip__opts__hooks.html#ga6cc92f5101dd7a0420e18e1f2101abf4">LWIP_HOOK_UNKNOWN_ETH_PROTOCOL</a> </dd>
<dd>
<a class="el" href="group__lwip__opts__arp.html#ga70ce0ecf56cf5fab000134e66d863f90">ETHARP_SUPPORT_VLAN</a> </dd>
<dd>
<a class="el" href="group__lwip__opts__hooks.html#ga2f020543772368f8f4355f50f24c86a9">LWIP_HOOK_VLAN_CHECK</a> </dd></dl>

</div>
</div>
<a id="ga3c420dab0c6760df099a2d688fa42a26"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3c420dab0c6760df099a2d688fa42a26">&#9670;&nbsp;</a></span>ip_input()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> ip_input </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>inp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>If both IP versions are enabled, this function can dispatch packets to the correct one. Don't call directly, pass to <a class="el" href="group__netif.html#gade5498543e74067f28cc6bef0209e3be">netif_add()</a> and call netif-&gt;input(). </p>

</div>
</div>
<a id="ga0c1a18439524d2f4a5e51d25c0ca2ce9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0c1a18439524d2f4a5e51d25c0ca2ce9">&#9670;&nbsp;</a></span>lwip_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void lwip_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialize all modules. Use this in NO_SYS mode. Use <a class="el" href="group__lwip__os.html#ga1f3a88b8df6ba3b9ed1c00e0a305e3db">tcpip_init()</a> otherwise. </p>

</div>
</div>
<a id="ga5532f93d68c874fb99c681bff2165385"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5532f93d68c874fb99c681bff2165385">&#9670;&nbsp;</a></span>netif_input()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> netif_input </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>inp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Forwards a received packet for input processing with <a class="el" href="group__lwip__nosys.html#ga6a10c58b82c56d02c48b3cfa2c2494ff">ethernet_input()</a> or <a class="el" href="group__lwip__nosys.html#ga3c420dab0c6760df099a2d688fa42a26">ip_input()</a> depending on netif flags. Don't call directly, pass to <a class="el" href="group__netif.html#gade5498543e74067f28cc6bef0209e3be">netif_add()</a> and call netif-&gt;input(). Only works if the netif driver correctly sets NETIF_FLAG_ETHARP and/or NETIF_FLAG_ETHERNET flag! </p>

</div>
</div>
<a id="ga83cffdf69ab60fd0eba9d17d363f9883"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga83cffdf69ab60fd0eba9d17d363f9883">&#9670;&nbsp;</a></span>sys_check_timeouts()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sys_check_timeouts </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Handle timeouts for NO_SYS==1 (i.e. without using tcpip_thread/sys_timeouts_mbox_fetch(). Uses <a class="el" href="group__sys__time.html#ga11316ac1e77418c6fa4ab8869e3fa199">sys_now()</a> to call timeout handler functions when timeouts expire.</p>
<p>Must be called periodically from your main loop. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
